import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store/index";
import filters from "./assets/filters/TimeObjectFormatting";
import AMap from "vue-amap";

import {
  Swipe,
  SwipeItem,
  Lazyload,
  Button,
  Popup,
  DatetimePicker,
  Row,
  Col,
  Cell,
  CellGroup,
  Field,
  Tab,
  Tabs,
  Image,
  Card,
  Icon,
  NavBar,
  DropdownMenu,
  DropdownItem,
  SwitchCell,
  Toast,
  NoticeBar,
  Tag,
  CouponCell,
  CouponList,
  Sidebar,
  SidebarItem,
  Tabbar,
  TabbarItem,
  RadioGroup,
  Radio,
  Loading,
  Rate,
  Collapse,
  CollapseItem
} from "vant";
import "lib-flexible";
import "./assets/styles/iconfont.css";
import "./assets/styles/reset.css";
// import "./assets/styles/border.css";
Vue.use(Swipe)
  .use(SwipeItem)
  .use(Lazyload)
  .use(Button)
  .use(Popup)
  .use(DatetimePicker)
  .use(Row)
  .use(Col)
  .use(Field)
  .use(Cell)
  .use(CellGroup)
  .use(Tab)
  .use(Tabs)
  .use(Image)
  .use(Card)
  .use(Icon)
  .use(NavBar)
  .use(DropdownMenu)
  .use(DropdownItem)
  .use(SwitchCell)
  .use(Toast)
  .use(NoticeBar)
  .use(Tag)
  .use(CouponCell)
  .use(CouponList)
  .use(SidebarItem)
  .use(Sidebar)
  .use(Tabbar)
  .use(TabbarItem)
  .use(RadioGroup)
  .use(Radio)
  .use(Loading)
  .use(Rate)
  .use(Collapse)
  .use(CollapseItem);

Vue.use(AMap);
AMap.initAMapApiLoader({
  key: "e793d140ef971b56ea4abc443302fe49", //这里填写自己申请的key
  plugin: [
    "AMap.Autocomplete",
    "AMap.PlaceSearch",
    "AMap.Scale",
    "AMap.OverView",
    "AMap.ToolBar",
    "AMap.MapType",
    "AMap.PolyEditor",
    "AMap.CircleEditor",
    "AMap.Geolocation"
  ]
});
Vue.config.productionTip = false;

// 过滤器统一加载处理
// Object.keys(filters).forEach(key => {
//   Vue.filter(key, filters[key]);
// });
for (let key in filters) {
  Vue.filter(key, filters[key]);
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
